home *** CD-ROM | disk | FTP | other *** search
- Path: harbinger.cc.monash.edu.au!wombat-1
- From: aglow1@mugc.cc.monash.edu.au (Andrew Lowe)
- Newsgroups: comp.lang.c++
- Subject: Implementing A New Project
- Date: Mon, 04 Mar 96 13:50:07 GMT
- Organization: Monash University
- Message-ID: <4herul$mqf@harbinger.cc.monash.edu.au>
- NNTP-Posting-Host: mugca.cc.monash.edu.au
- X-NNTP-Posting-User: aglow1
- X-Newsreader: News Xpress 2.0 Beta #0
- Keyword: C++ Engineering
-
- Having been programming in C for 10 years and the last two in C++ I am
- still only using C++ as a slightly glorified C. I am attempting to get out of
- this mind set but need some advice on a project I am about to start.
-
- The project in question is whats called a structural analysis package.
- Programs of this type are used by structural engineers in the analysis and
- design of structures ranging in size and complexity from domestic dwellings to
- oil rigs and 100 storey buildings. The way the program works is that there are
- points in space called nodes. Nodes usually have an number and a set of
- coordinates. These are not physical, they serve to indicate a start or end
- point. In turn members, such as beams and columns, are defined as running
- between points. Members have properties such as cross sectional area, moments
- of inertia and the like. They are also made of a material such as steel. The
- members also have loads applied to them.
-
- The question is how do I use C++ to its best advantage to develop this
- system. In my current mindset of using C++ as a glorified C I have worked out
- the following class setup:
-
- class building {
- class *nodeList;
- class *memberList;
- class *sectPropList;
- class *materialList;
- .......
- .......
- .......
- };
-
- class _nodeList {
- int nodeNumber;
- float X; // 3D coords
- float Y;
- float Z;
- ......
- ......
- ......
- };
-
- //
- // The props for, say, a steel beam
- //
- class _sectProps {
- int sectNo;
- float area;
- float Ix;
- float Iy;
- .....
- .....
- .....
- };
-
- //
- // A loading class
- //
- class _membLoad {
- float position;
- float magnitude
- int direction;
- .....
- .....
- .....
- _membLoad *nextMembLoad;
- };
-
- class _memberList {
- int nodeStart; //contains start node
- int nodeEnd; //contains end node
- int sectNo; // The sect props for the member
- _membLoad *firstLoad; // Loading on member - linked list
- .....
- .....
- .....
- };
-
- I hope this makes sense. What I am trying to do is show that the
- building is the main object. This object is in turn made up of component parts
- such as the nodes and members. The members are defined as running between the
- nodes and the loads are defined in relation to the members.......sort of thing
- if you get my drift!!!!!!
-
- Inthe considered opinion of the news group readers is there a better
- way, a more C++ way of doing this?
-
- I await your replies.
-
- Regards,
- Andrew Lowe
-
-
- //***************************************************************************\\
- || Andrew Lowe B.Eng(Civil) *|* Christ himself, on the cross, told ||
- || aglow1@mugc.cc.monash.edu.au *|* the guy who banged in the nails ||
- || Structural Engineer & *|* "Mate things they can't be all that ||
- || Computer Science student *|* bad when Derryn Hinch goes to gaol".||
- || Monash University (Gippland) *|* - TISM ||
- || Australia *|* ||
- \\***************************************************************************//
-